package com.terren.spider.util.common;


import javax.xml.parsers.FactoryConfigurationError;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

import com.terren.spider.entity.config.SysConfig;





/**
 * 常用工具类
 * @author Administrator
 *
 */
public class LogUtil {
	
	public static Logger logger = getLogger(LogUtil.class);
	public static void initLogger() {
		try {
			DOMConfigurator.configure(SysConfig.LOG4J_PATH);
		}  catch (FactoryConfigurationError e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	/**
	 * 获得log4j logger 对象
	 * @param clazz
	 * @return
	 */
	public static Logger getLogger(Class<?> clazz){
		Logger logger = Logger.getLogger(clazz);
		return logger;
	}
	
}
